package com.nian.mongodb.service.model;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;

/**
 * 用途：部门类
 * 开发：zhangmj
 * 日期：2020/4/12 18:31
 */
@Data
@Document(collection = "department")
public class Department implements Serializable {

    @Id
    private String id;
    /**
     * 名称
     */
    private String name;
    /**
     * 代码
     */
    private String code;
    /**
     * 备注
     */
    private String remark;

    /**
     * 所属公司
     */
    private String companyId;
//    @DBRef
//    private Company companyId;

    public Department(String id, String name, String code, String remark, String companyId) {
        this.id = id;
        this.name = name;
        this.code = code;
        this.remark = remark;
        this.companyId = companyId;
    }
}
